// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------

import request from '@/plugins/request';

/**
 * @description ca客户 -- 列表
 * @param {Object} param params {Object} 传值参数
 */
export function storeCustomerListApi(params) {
    return request({
        url: `store_customer/list`,
        method: 'GET',
        params
    });
}

/**
 * @description ca客户 -- 添加
 * @param {Number} param id {Number} 客户id
 * @param {Object} param data {Object} 传值参数
 */
export function storeCustomreAddApi(data, id) {
    return request({
        url: `store_customer/createStoreCustomer/${id}`,
        method: 'POST',
        data
    });
}

/**
 * @description 商品属性 -- 详情
 * @param {Number} param id {Number} 属性id
 */
export function storeCustomerInfoApi(id) {
    return request({
        url: `store_customer/findStoreCustomer/${id}`,
        method: 'get'
    });
}

/**
 * @description 客户删除
 */
export function cacheDelete(id) {
    return request({
        url: 'store_customer/del/${id}',
        method: 'delete'
    });
}

/**
 * 语言列表
 */
export function languagesListApi(data) {
    return request({
        url: `/product/languages_list`,
        method: 'get',
        params: data
    });
}

/**
 * 地区列表
 */
export function statesListApi(data) {
    return request({
        url: `/product/states_list`,
        method: 'get',
        params: data
    });
}
/**
 * 国家列表
 */
export function countryListApi(data) {
    return request({
        url: `/product/country_list`,
        method: 'get',
        params: data
    });
}

//添加标签
export function createTagsApi(data, id) {
    return request({
        url: `tags/createTag/${id}`,
        method: 'POST',
        data
    });
}
//检查手机是否存在
export function checkPhoneExistApi(data) {
    return request({
        url: `store_customer/checkPhoneExist`,
        method: 'get',
        params: data
    });
}
//检查邮箱是否存在
export function checkEmailExistApi(data) {
    return request({
        url: `store_customer/checkEmailExist`,
        method: 'get',
        params: data
    });
}
//标签列表
export function tagsListApi() {
    return request({
        url: `store_customer/tagsList`,
        method: 'get',
    });
}
//客户详情
export function storeCustomerDetailApi(id) {
    return request({
        url: `store_customer/storeCustomerDetail/${id}`,
        method: 'get'
    });
}

/**
 * 导出客户列表
 */
export function exportStoreCustomerList(data) {
    return request({
        url: `/store_customer/exportStoreCustomerList`,
        method: 'get',
        params: data
    });
}

export function createStoreCustomreAccessApi(data) {
    return request({
        url: `store_customer/add_access_customer`,
        method: 'POST',
        data
    });
}

export function customerAccessListApi(params) {
    return request({
        url: `store_customer/store_customer_access`,
        method: 'GET',
        params
    });
}

export function storeCustomerAccessDetailApi(id) {
    return request({
        url: `store_customer/storeCustomerAccessDetail/${id}`,
        method: 'get'
    });
}

export function accessDelete(id) {
    return request({
        url: 'store_customer/access_del/${id}',
        method: 'delete'
    });
}

export function getQuestionListApi(id) {
    return request({
        url: `store_customer/customer_question_list/${id}`,
        method: 'get'
    });
}

export function addQuestionApi(data, id) {
    return request({
        url: `store_customer/add_question/${id}`,
        method: 'POST',
        data
    });
}

export function getUserInfoApi() {
    return request({
        url: `store_customer/get_user_info`,
        method: 'POST'
    });
}